//密码强度验证
function AuthPasswd(obj) {
	var string = obj.value;
    if(string.length >=3) {
        if(/[a-zA-Z]+/.test(string) && /[0-9]+/.test(string) && /\W+\D+/.test(string)) {
            noticeAssign(1);
        }else if(/[a-zA-Z]+/.test(string) || /[0-9]+/.test(string) || /\W+\D+/.test(string)) {
            if(/[a-zA-Z]+/.test(string) && /[0-9]+/.test(string)) {
                noticeAssign(-1);
            }else if(/\[a-zA-Z]+/.test(string) && /\W+\D+/.test(string)) {
                noticeAssign(-1);
            }else if(/[0-9]+/.test(string) && /\W+\D+/.test(string)) {
                noticeAssign(-1);
            }else{
                noticeAssign(0);
            }
        }
    }else if(string.length<3 && string.length>0){
    	noticeAssign(0);
    }else{
    	noticeAssign(null); 
    }
}

//分派提示信息
function noticeAssign(num) {
    if(num == 1) {
        $('#weak').css({backgroundColor:'#5CB85C'});
        $('#middle').css({backgroundColor:'#5CB85C'});
        $('#strength').css({backgroundColor:'#5CB85C'});
        $('#strength').html("<font color='black'>强</font>");
        $('#middle').html('');
        $('#weak').html('');
    }else if(num == -1){
        $('#weak').css({backgroundColor:'#F0AD4E'});
        $('#middle').css({backgroundColor:'#F0AD4E'});
        $('#strength').css({backgroundColor:''});
        $('#weak').html('');
        $('#middle').html("<font color='black'>中</font>");
        $('#strength').html('');
    }else if(num ==0) {
        $('#weak').css({backgroundColor:'#D9534F'});
        $('#middle').css({backgroundColor:''});
        $('#strength').css({backgroundColor:''});
        $('#weak').html("<font color='black'>弱</font>");
        $('#middle').html('');
        $('#strength').html('');
    }else{
        $('#weak').html('');
        $('#middle').html('');
        $('#strength').html('');
        $('#weak').css({backgroundColor:''});
        $('#middle').css({backgroundColor:''});
        $('#strength').css({backgroundColor:''});
    }
}

//检查姓名
function checkName(obj) {
	var temp = $.trim(obj.value);	//去掉前后空格
	if(temp != ""){
		 var re = /[^\u4e00-\u9fa5]/;  
		 if(re.test(temp)){
			 $("#nameTip").html("<font color='red'>姓名必须为中文!</font>");
		 }else{
			 $("#nameTip").html("<font color='green'>姓名可用</font>");
		 }
	}else{
		 $("#nameTip").html("<font color='red'>姓名不能为空</font>");
	}
}

//等待gif
function loading() {
	$('#loader').shCircleLoader();
}


